﻿@model CoreData.Order
@{ 
    ViewBag.Title = "Update order";
}
<div class="row-fluid">
    <div class="span12">
        <div class="head">
            <div class="isw-documents">
            </div>
            <h1>
              Order</h1>
            <div class="clear">
            </div>
        </div>
        <div class="block-fluid tabs">
            @using (Ajax.BeginForm("AddOrUpdate", "OrderManagement", new AjaxOptions { OnSuccess = "Success", HttpMethod = "Post" }, new { enctype = "multipart/form-data", @id = "validation" }))
            {
                <div class="warning-area">
                </div>
                @Html.HiddenFor(x => x.ID)
                <div class="row-form">
                    <div class="span2">
                        Code</div>
                    <div class="span9">
                        # @Html.DisplayTextFor(x => x.ID)</div>
                    <div class="clear">
                    </div>
                </div>                
                <div class="row-form">
                    <div class="span2">
                        Customer</div>
                    <div class="span9">
                        @Html.HiddenFor(c => c.UserID)
                        @Html.HiddenFor(c => c.Name)
                        @Html.DisplayTextFor(x => x.Name)</div>
                    <div class="clear">
                    </div>
                </div>
                <div class="row-form">
                    <div class="span2">
                        Address</div>
                    <div class="span9">
                        @Html.HiddenFor(x => x.Address)
                        @Html.DisplayTextFor(x => x.Address)</div>
                    <div class="clear">
                    </div>
                </div>
                <div class="row-form">
                    <div class="span2">
                        Phone</div>
                    <div class="span9">
                        @Html.HiddenFor(x => x.Phone)
                        @Html.DisplayTextFor(x => x.Phone)</div>
                    <div class="clear">
                    </div>
                </div>
              
                <div class="row-form">
                    <div class="span2">
                        Ship fee (USD)</div>
                    <div class="span9">
                        @Html.TextBoxFor(x => x.Ship_Fee, new { @class = "validate[required,custom[integer]]" })</div>
                    <div class="clear">
                    </div>
                </div>
               
                <div class="row-form">
                    <div class="span2">
                       Create date</div>
                    <div class="span9">
                        @Html.HiddenFor(c => c.CreateDate)
                        @Html.DisplayTextFor(x => x.CreateDate)</div>
                    <div class="clear">
                    </div>
                </div>
              
                <div class="row-form">
                    <div class="span2">
                       Deliver date</div>
                    <div class="span9">
                        @Html.HiddenFor(c => c.DateCompleted)
                        @if (Model.DateCompleted == DateTime.MinValue)
                        {
                            @Html.Label("Not deliver")
                        }
                        else
                        {
                            @Html.DisplayTextFor(x => x.DateCompleted)
                        }
                    </div>
                    <div class="clear">
                    </div>
                </div>
                 
                <div class="row-form">
                    <div class="span2">
                        Total money</div>
                    <div class="span9">
                        @Html.HiddenFor(x => x.TotalPrice)
                        @Helper.StringHelper.FormatCurrencyUS(Model.TotalPrice)
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="row-form">
                    <div class="span2">
                        Note</div>
                    <div class="span9">
                        @Html.TextAreaFor(x => x.Note)
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="row-form">
                    <div class="span2">
                        Status :</div>
                    <div class="span9">
                        @Html.HiddenFor(x => x.Active)
                        @Html.DropDownListFor(x => x.Status, Model.ListStatusExt, new { @class = "validate[required]" })
                    </div>
                    <div class="clear">
                    </div>
                </div>
                        if (Helper.SessionManagement.Value("pvalue").Contains("U") || Helper.SessionManagement.Value("pvalue").Contains("C"))
                        {
                <div class="row-form">
                    <div class="span2">
                    </div>
                    <div class="span9">
                        <input type="submit" class="btn btn-info span3" value="Update" /></div>
                    <div class="clear">
                    </div>
                </div>
                        }
            }
        </div>
    </div>
</div>
